package com.shtel.bss.saas.tenant.entity.repository.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shtel.bss.saas.tenant.entity.SysGlobalAuth;
import com.shtel.bss.saas.tenant.mapper.SysGlobalAuthMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.shtel.bss.saas.tenant.entity.repository.ISysGlobalAuthRepository;

import java.util.List;


/**
 * sys_global_auth仓库现实类
 * @author xiezhiwei 2020-02-05 21:21
 */
@Repository("sysGlobalAuthRepository")
public class SysGlobalAuthRepositoryImpl implements ISysGlobalAuthRepository {

    @Autowired
    private SysGlobalAuthMapper sysGlobalAuthMapper;

    @Override
    public PageInfo<SysGlobalAuth> selectEntity(SysGlobalAuth sysGlobalAuth, int pageSize, int pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        PageInfo<SysGlobalAuth> pageInfo = new PageInfo(sysGlobalAuthMapper.selectEntity(sysGlobalAuth));
        return pageInfo;
    }

    @Override
    public void updateEntity(SysGlobalAuth sysGlobalAuth) {
        sysGlobalAuthMapper.updateEntity(sysGlobalAuth);
    }

    @Override
    public PageInfo<SysGlobalAuth> selectEntityByTenantId(Long tenantId, int pageSize, int pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        PageInfo<SysGlobalAuth> pageInfo = new PageInfo(sysGlobalAuthMapper.selectEntityByTenantId(tenantId));
        return pageInfo;
    }

    @Override
    public List<SysGlobalAuth> selectEntity(SysGlobalAuth sysGlobalAuth) {
        return sysGlobalAuthMapper.selectEntity(sysGlobalAuth);
    }

    @Override
    public List<SysGlobalAuth> selectEntityByTenantId(Long tenantId) {
        return sysGlobalAuthMapper.selectEntityByTenantId(tenantId);
    }
}